This file is indexed.

/usr/share/gap/pkg/ctbllib/gap4/ctadmin.tbd is in gap-character-tables 1r1p3-5.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

   1
   2
   3
   4
   5
   6
   7
   8
   9
  10
  11
  12
  13
  14
  15
  16
  17
  18
  19
  20
  21
  22
  23
  24
  25
  26
  27
  28
  29
  30
  31
  32
  33
  34
  35
  36
  37
  38
  39
  40
  41
  42
  43
  44
  45
  46
  47
  48
  49
  50
  51
  52
  53
  54
  55
  56
  57
  58
  59
  60
  61
  62
  63
  64
  65
  66
  67
  68
  69
  70
  71
  72
  73
  74
  75
  76
  77
  78
  79
  80
  81
  82
  83
  84
  85
  86
  87
  88
  89
  90
  91
  92
  93
  94
  95
  96
  97
  98
  99
 100
 101
 102
 103
 104
 105
 106
 107
 108
 109
 110
 111
 112
 113
 114
 115
 116
 117
 118
 119
 120
 121
 122
 123
 124
 125
 126
 127
 128
 129
 130
 131
 132
 133
 134
 135
 136
 137
 138
 139
 140
 141
 142
 143
 144
 145
 146
 147
 148
 149
 150
 151
 152
 153
 154
 155
 156
 157
 158
 159
 160
 161
 162
 163
 164
 165
 166
 167
 168
 169
 170
 171
 172
 173
 174
 175
 176
 177
 178
 179
 180
 181
 182
 183
 184
 185
 186
 187
 188
 189
 190
 191
 192
 193
 194
 195
 196
 197
 198
 199
 200
 201
 202
 203
 204
 205
 206
 207
 208
 209
 210
 211
 212
 213
 214
 215
 216
 217
 218
 219
 220
 221
 222
 223
 224
 225
 226
 227
 228
 229
 230
 231
 232
 233
 234
 235
 236
 237
 238
 239
 240
 241
 242
 243
 244
 245
 246
 247
 248
 249
 250
 251
 252
 253
 254
 255
 256
 257
 258
 259
 260
 261
 262
 263
 264
 265
 266
 267
 268
 269
 270
 271
 272
 273
 274
 275
 276
 277
 278
 279
 280
 281
 282
 283
 284
 285
 286
 287
 288
 289
 290
 291
 292
 293
 294
 295
 296
 297
 298
 299
 300
 301
 302
 303
 304
 305
 306
 307
 308
 309
 310
 311
 312
 313
 314
 315
 316
 317
 318
 319
 320
 321
 322
 323
 324
 325
 326
 327
 328
 329
 330
 331
 332
 333
 334
 335
 336
 337
 338
 339
 340
 341
 342
 343
 344
 345
 346
 347
 348
 349
 350
 351
 352
 353
 354
 355
 356
 357
 358
 359
 360
 361
 362
 363
 364
 365
 366
 367
 368
 369
 370
 371
 372
 373
 374
 375
 376
 377
 378
 379
 380
 381
 382
 383
 384
 385
 386
 387
 388
 389
 390
 391
 392
 393
 394
 395
 396
 397
 398
 399
 400
 401
 402
 403
 404
 405
 406
 407
 408
 409
 410
 411
 412
 413
 414
 415
 416
 417
 418
 419
 420
 421
 422
 423
 424
 425
 426
 427
 428
 429
 430
 431
 432
 433
 434
 435
 436
 437
 438
 439
 440
 441
 442
 443
 444
 445
 446
 447
 448
 449
 450
 451
 452
 453
 454
 455
 456
 457
 458
 459
 460
 461
 462
 463
 464
 465
 466
 467
 468
 469
 470
 471
 472
 473
 474
 475
 476
 477
 478
 479
 480
 481
 482
 483
 484
 485
 486
 487
 488
 489
 490
 491
 492
 493
 494
 495
 496
 497
 498
 499
 500
 501
 502
 503
 504
 505
 506
 507
 508
 509
 510
 511
 512
 513
 514
 515
 516
 517
 518
 519
 520
 521
 522
 523
 524
 525
 526
 527
 528
 529
 530
 531
 532
 533
 534
 535
 536
 537
 538
 539
 540
 541
 542
 543
 544
 545
 546
 547
 548
 549
 550
 551
 552
 553
 554
 555
 556
 557
 558
 559
 560
 561
 562
 563
 564
 565
 566
 567
 568
 569
 570
 571
 572
 573
 574
 575
 576
 577
 578
 579
 580
 581
 582
 583
 584
 585
 586
 587
 588
 589
 590
 591
 592
 593
 594
 595
 596
 597
 598
 599
 600
 601
 602
 603
 604
 605
 606
 607
 608
 609
 610
 611
 612
 613
 614
 615
 616
 617
 618
 619
 620
 621
 622
 623
 624
 625
 626
 627
 628
 629
 630
 631
 632
 633
 634
 635
 636
 637
 638
 639
 640
 641
 642
 643
 644
 645
 646
 647
 648
 649
 650
 651
 652
 653
 654
 655
 656
 657
 658
 659
 660
 661
 662
 663
 664
 665
 666
 667
 668
 669
 670
 671
 672
 673
 674
 675
 676
 677
 678
 679
 680
 681
 682
 683
 684
 685
 686
 687
 688
 689
 690
 691
 692
 693
 694
 695
 696
 697
 698
 699
 700
 701
 702
 703
 704
 705
 706
 707
 708
 709
 710
 711
 712
 713
 714
 715
 716
 717
 718
 719
 720
 721
 722
 723
 724
 725
 726
 727
 728
 729
 730
 731
 732
 733
 734
 735
 736
 737
 738
 739
 740
 741
 742
 743
 744
 745
 746
 747
 748
 749
 750
 751
 752
 753
 754
 755
 756
 757
 758
 759
 760
 761
 762
 763
 764
 765
 766
 767
 768
 769
 770
 771
 772
 773
 774
 775
 776
 777
 778
 779
 780
 781
 782
 783
 784
 785
 786
 787
 788
 789
 790
 791
 792
 793
 794
 795
 796
 797
 798
 799
 800
 801
 802
 803
 804
 805
 806
 807
 808
 809
 810
 811
 812
 813
 814
 815
 816
 817
 818
 819
 820
 821
 822
 823
 824
 825
 826
 827
 828
 829
 830
 831
 832
 833
 834
 835
 836
 837
 838
 839
 840
 841
 842
 843
 844
 845
 846
 847
 848
 849
 850
 851
 852
 853
 854
 855
 856
 857
 858
 859
 860
 861
 862
 863
 864
 865
 866
 867
 868
 869
 870
 871
 872
 873
 874
 875
 876
 877
 878
 879
 880
 881
 882
 883
 884
 885
 886
 887
 888
 889
 890
 891
 892
 893
 894
 895
 896
 897
 898
 899
 900
 901
 902
 903
 904
 905
 906
 907
 908
 909
 910
 911
 912
 913
 914
 915
 916
 917
 918
 919
 920
 921
 922
 923
 924
 925
 926
 927
 928
 929
 930
 931
 932
 933
 934
 935
 936
 937
 938
 939
 940
 941
 942
 943
 944
 945
 946
 947
 948
 949
 950
 951
 952
 953
 954
 955
 956
 957
 958
 959
 960
 961
 962
 963
 964
 965
 966
 967
 968
 969
 970
 971
 972
 973
 974
 975
 976
 977
 978
 979
 980
 981
 982
 983
 984
 985
 986
 987
 988
 989
 990
 991
 992
 993
 994
 995
 996
 997
 998
 999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
#############################################################################
##
#W  ctadmin.tbd         GAP character table library             Thomas Breuer
#W                                                               Ute Schiffer
##
#H  @(#)$Id: ctadmin.tbd,v 4.59 2004/02/18 17:44:54 gap Exp $
##
#Y  Copyright (C)  1997,  Lehrstuhl D fuer Mathematik,  RWTH Aachen,  Germany
##
##  This file contains the declaration part of the data of the {\GAP}
##  character table library that is not automatically produced from the
##  library files.
##
##  0. Global variables to handle the table library.
##  1. Representations of library tables
##  2. Functions used in the library files
##  3. Functions to construct library tables
##  4. Functions used as `construction' component of library tables
##  5. Selection functions for the table library
##  6. Functions to produce tables in library format
##
Revision.( "ctbllib/gap4/ctadmin_tbd" ) :=
    "@(#)$Id: ctadmin.tbd,v 4.59 2004/02/18 17:44:54 gap Exp $";


#############################################################################
##
#1
##  The data files of the {\GAP} Character Table Library
##  reside in the `data' directory of the package `ctbllib'.
##
##  The filenames start with `ct' (for ``character table''),
##  followed by either `o' (for ``ordinary''), `b' (for ``Brauer''),
##  or `g' (for ``generic''),
##  then a description of the contents (up to $5$ characters, e.g., `alter'
##  for the tables of alternating and related groups),
##  and the suffix `.tbl'.
##
##  The file `ctb<descr>.tbl' contains the known Brauer tables
##  corresponding to the ordinary tables in the file `cto<descr>.tbl'.
##
##  Each data file of the table library is supposed to consist of
##  \beginlist
##  \item{1.}
##      comment lines, starting with `#' in the first column,
##  \item{2.}
##      assignments to `ALN' (short for ``add library name'',
##      see~"NotifyNameOfCharacterTable")
##      and to a component of `Revision', at the beginning of the file,
##      for example in the file with name `ctoalter.tbl' a value is assigned
##      to `Revision.ctoalter_tbl',
##  \item{3.}
##      assignments to `ALN' and to a component of `LIBTABLE.LOADSTATUS',
##      at the end of the file, and
##  \item{4.}
##      function calls of the form
##      `SET_TABLEFILENAME( <filename> )',
##      `MBT( <name>, <data> )' (``make Brauer table''),
##      `MOT( <name>, <data> )' (``make ordinary table''),
##      `ALF( <from>, <to>, <map> )',
##      `ALF( <from>, <to>, <map>, <textlines> )' (``add library fusion''),
##      `ALN( <name>, <listofnames> )', and
##      `ARC( <name>, <component>, <compdata> )' (``add record component'').
##
##      Here <filename> must be a string corresponding to the filename but
##      without suffix, for example `\"ctoalter\"' if the file has the name
##      `ctoalter.tbl';
##      <name> must be the identifier value of the ordinary character table
##      corresponding to the table to which the command refers;
##      <data> must be a comma separated sequence of {\GAP} objects;
##      <from> and <to> must be identifier values of ordinary character
##      tables,
##      <map> a list of positive itegers,
##      <textlines> and <listofnames> lists list of strings,
##      <component> a string, and
##      <compdata> any {\GAP} object.
##
##      `MOT', `ALF', `ALN', and `ARC' occur only in files containing
##      ordinary character tables,
##      and `MBT' occurs only in files containing Brauer tables.
##  \endlist
##  Besides the above calls, the data in files containing ordinary and Brauer
##  tables may contain only the following {\GAP} functions.
##  (Files containing generic character tables may contain calls to
##  arbitrary {\GAP} library functions.)
##
##  `ACM',
##  `Concatenation',
##  `E',
##  `EvalChars',
##  `GALOIS',
##  `Length',
##  `NotifyCharTableName',
##  `ShallowCopy',
##  `TENSOR', and
##  `TransposedMat'.
##
##  The `awk' script `maketbl' in the `etc' directory of the `ctbllib'
##  package expects the file format described above,
##  and to some extent this format is checked by this script.
##
##  The function calls may be continued over several lines of a file.
##  A semicolon is assumed to be the last character in its line
##  if and only if it terminates a function call.
##
##  Names of character tables are strings
##  (see Chapter~"ref:Strings and Characters" in the {\GAP} Reference Manual),
##  i.e., they are enclosed in double quotes;
##  strings in table library files must not be split over several lines,
##  because otherwise the `awk' script may get confused.
##  Additionally, no character table name is allowed to contain double
##  quotes.
##
##  {\GAP}'s knowledge about the ordinary tables in the table library
##  is given by the file `ctprimar.tbl' (the ``primary file'' of the
##  table library).
##  This file can be produced from the library files by the script `maketbl'
##  in the `etc' directory of the `ctbllib' package.
##  The information is stored in the global variable `LIBLIST',
##  which is a record with the following components.
##  \beginitems
##  `firstnames' &
##      the list of `Identifier' (see~"ref:Identifier!for character tables"
##      in the {\GAP} Reference Manual) values of the ordinary tables,
##
##  `files' &
##      the list of filenames containing the data of ordinary tables,
##
##  `filenames' &
##      a list of positive integers, value $j$ at position $i$ means that the
##      table whose identifier is the $i$--th in the `firstnames' list is
##      contained in the $j$-th file of the `files' component,
##
##  `fusionsource' &
##      a list containing at position $i$ the list of names of tables that
##      store a fusion into the table whose identifier is the $i$--th in the
##      `firstnames' list,
##
##  `allnames' &
##      a list of all admissible names of ordinary library tables,
##
##  `position' &
##      a list that stores at position $i$ the position in `firstnames'
##      of the identifier of the table with the $i$--th admissible name in
##      `allnames',
##
##  `projections' &
##      a list of triples $[ <name>, <factname>, <map> ]$
##      describing a factor fusion <map> from the table with identifier
##      <name> to the table with identifier <factname>
##      (this is used to construct the table of <name> using the data of
##      the table of <factname>),
##
##  `simpleinfo' &
##      a list of triples $[ <m>, <name>, <a> ]$ describing the tables of
##      simple groups in the library; <name> is the identifier of the table,
##      `<m>.<name>' and `<name>.<a>' are admissible names for its
##      Schur multiplier and automorphism group, respectively,
##
##  `sporadicSimple' &
##      a list of identifiers of the tables of the $26$ sporadic simple
##      groups, and
##
##  `GENERIC' &
##      a record with information about generic tables
##      (see~"Generic Character Tables").
##  \enditems
##
##  There are three different ways how the table data can be stored in the
##  file.
##
##  *Full ordinary tables* are encoded by a call to the function `MOT',
##  where the arguments correspond to the relevant attribute values;
##  each fusion into another library table is added by a call to `ALF',
##  values to be stored in components of the table object are added with
##  `ARC', and admissible names are notified with `ALN'.
##  The argument of `MOT' that encodes the irreducible characters is
##  abbreviated as follows.
##  For each subset of characters that differ just by multiplication with a
##  linear character or by Galois conjugacy, only the first one is given by
##  its values, the others are replaced by
##  `[TENSOR,[<i>,<j>]]' (which means that the character is the tensor
##  product of the <i>-th and the <j>-th character in the list)
##  or `[GALOIS,[<i>,<j>]]' (which means that the character is obtained from
##  the <i>-th character by applying `GaloisCyc( ., <j> )' to it.
##
##  *Brauer tables* are stored relative to the corresponding ordinary tables;
##  attribute values that can be got by restriction from the ordinary table
##  to $p$--regular classes are not stored,
##  and instead of the irreducible characters the files contain (inverses of)
##  decomposition matrices or Brauer trees for the blocks of nonzero defects.
##
##  *Ordinary construction tables* have the attribute
##  `ConstructionInfoCharacterTable' (see~"ConstructionInfoCharacterTable")
##  set, with value a list that contains the name of the construction
##  function used and the arguments for a call to this function;
##  The function call is performed by `CharacterTable' when the table is
##  constructed (*not* when the file containing the table is read).
##  The aim of this mechanism is to store structured character tables such as
##  tables of direct products and tables of central extensions of other
##  tables in a compact way.
##

#############################################################################
##
##  0. Global variables to handle the table library.
##

#############################################################################
##
#V  LIBTABLE
##
##  is a record with the components
##  \beginitems
##  `LOADSTATUS' &
##     a record whose components are names of files in the table library,
##     with value one of `\"loaded\"', `\"unloaded\"', `\"userloaded\"',
##
##  `TABLEFILENAME' &
##     the name of the file that is currently read
##     (is set by `SET_TABLEFILENAME'),
##
##  `unload' &
##     a Boolean, only one file with ordinary character tables plus perhaps
##     the corresponding file with Brauer tables is kept in memory if the
##     value is `true' (which is the default),
##
##  `clmelab' &
##     the list for Clifford matrices of extensions by elementary abelian
##     normal subgroups
##
##  `clmexsp' &
##     the list for Clifford matrices of extensions by extraspecial normal
##     subgroups
##  \enditems
##  Additionally the filenames of loaded and userloaded files occur as
##  components, with values the lists of data stored in the files.
##
BindGlobal( "LIBTABLE", rec(
                 LOADSTATUS    := rec(),
                 TABLEFILENAME := "",
                 unload        := true,
                 clmelab       := [],
                 clmexsp       := []
                ) );


#############################################################################
##
##  OrderCyc( <cyc> )
##
##  This is needed for backward compatibility.
##  A call of `OrderCyc' (with one argument) occurs in `ctgeneri.tbl',
##  it cannot be replaced by `Order' because {\GAP}~3 does not accept it.
##
DeclareSynonym( "OrderCyc", Order );


#############################################################################
##
##  1. Representations of library tables
##
##  All these are in the library now, because the library accesses these.


#############################################################################
##
#F  SET_TABLEFILENAME( <filename> )
##
DeclareGlobalFunction( "SET_TABLEFILENAME" );


#############################################################################
##
##  2. Functions used in the library files
##

#############################################################################
##
#F  GALOIS( <chars>, <list> )
#F  TENSOR( <chars>, <list> )
##
##  are global variables used to store the library tables in compressed form.
##
##  The entry `[GALOIS,[<i>,<j>]]' in the `irreducibles' or `projectives'
##  component of a library table means the <j>-th Galois conjugate of
##  the <i>-th character.
##
##  The entry `[TENSOR,[<i>,<j>]]' in the `irreducibles' or `projectives'
##  component of a library table means the tensor product of the <i>-th
##  and the <j>-th character.
##
#F  EvalChars( <chars> )
##
##  replaces all entries of the form `[<func>,<list>]' in the list <chars>
##  by the result `<func>( <chars>, <list> )'.
##
DeclareGlobalFunction( "GALOIS" );
DeclareGlobalFunction( "TENSOR" );
DeclareGlobalFunction( "EvalChars" );


#############################################################################
##
#F  ALF( <from>, <to>, <map>[, <text>, <spec>] ) .  add library table fusions
##
##  `ALF' stores the fusion map <map> between the ordinary character tables
##  with identifier strings <from> and <to> in the record encoding the table
##  with identifier <from>.
##  If the string <text> is given then it is added as `text' component of the
##  fusion.
##  If the argument <spec> is given then it is added as `specification'
##  component of the fusion.
##
##  `ALF' changes the global list `LIBLIST.fusionsource'.
##
##  Note that the `ALF' statement should be placed in the file containing the
##  data for the table with identifier <from>.
##
DeclareGlobalFunction( "ALF" );


#############################################################################
##
#F  ACM( <spec>, <dim>, <val> )
##     adds a Clifford matrix to the library.
##     <spec> is one of the strings "elab", "exsp".
##     <dim> is the dimension of the Clifford matrix,
##     <val> is the Clifford matrix itself.
##
#F  ARC( <name>, <comp>, <val> )
##     adds the record component <comp> with value <val> to the table record
##     with name <name>.
##
##  These functions are used in the library table files,
##  so they assume that it is not necessary to read such a file before the
##  data can be stored.
##
DeclareGlobalFunction( "ACM" );
DeclareGlobalFunction( "ARC" );


#############################################################################
##
#F  NotifyNameOfCharacterTable( <firstname>, <newnames> )
#F  ALN( <firstname>, <newnames> )
##
##  notifies the strings in the list <newnames> as new admissible names for
##  the library table with `Identifier' value <firstname>,
##  see~"ref:Identifier!for character tables" in the {\GAP} Reference Manual.
##  If there is already another library table for which some of these names
##  are admissible then an error is signaled.
##
##  `NotifyNameOfCharacterTable' modifies the global variable `LIBLIST'.
##
##  `ALN' is a shorthand for `NotifyNameOfCharacterTable'.
##  In those library files for which the `maketbl' script has produced the
##  necessary information for `LIBLIST', `ALN' is set to `Ignore'
##  in the beginning and back to `NotifyNameOfCharacterTable' in the end.
##
DeclareGlobalFunction( "NotifyNameOfCharacterTable" );
ALN:= NotifyNameOfCharacterTable;  # We do not use `DeclareSynonym' here
                                   # because assignments are made to `ALN'
                                   # in data files.

#T because of the table files ...
NotifyCharTableName := NotifyNameOfCharacterTable;


#############################################################################
##
#F  NotifyCharacterTable( <firstname>, <filename>, <othernames> )
##
##  notifies a new ordinary table to the library.
##  This table has `Identifier' value <firstname>,
##  it is contained (in library format, see~"PrintToLib") in the file with
##  name <filename> (without suffix `.tbl'),
##  and the names contained in the list <othernames> are admissible for it.
##
##  If the initial part of <filename> is one of `~/', `/' or `./' then it is
##  interpreted as an *absolute* path.
##  Otherwise it is interpreted *relative* to the `data' directory of the
##  `ctbllib' package.
##
##  `NotifyCharacterTable' modifies the global variable `LIBLIST' for the
##  current {\GAP} session,
##  after having checked that there is no other library table yet with an
##  admissible name equal to <firstname> or contained in <othernames>.
##
DeclareGlobalFunction( "NotifyCharacterTable" );


#############################################################################
##
#F  NotifyCharTable( <firstname>, <filename>, <othernames> )
##
##  for compatibility with {\GAP}~3
##
DeclareSynonym( "NotifyCharTable", NotifyCharacterTable );


#############################################################################
##
#F  MBT( <arg> )
##
##  The library format of Brauer tables is a call to the function
##  `MBT', with the following arguments.
##
##   1. identifier of the table
##   2. field characteristic
##   3. text (list of lines)
##   4. block
##   5. defect
##   6. basic set
##   7. Brauer tree information
##   8. inverses of decomposition matrices restricted to basic sets
##   9. blocks of proper factor groups
##  10. list of generators for the group of table automorphisms
##  11. 2nd indicator (in characteristic 2 only)
##  12. (optional) record with additional components
##
##  `MBT' constructs a record and stores it in the record
##  `LIBTABLE.TABLEFILENAME'.
##
DeclareGlobalFunction( "MBT" );


#############################################################################
##
#F  MOT( <arg> )
##
##  The library format of ordinary character tables is a call to the function
##  `MOT', with the following arguments.
##
##   1. identifier of the table
##   2. text (list of lines)
##   3. list of centralizer orders
##   4. list of power maps
##   5. list of irreducibles
##   6. list of generators for the group of table automorphisms
##   7. (optional) construction of the table
##
##  Each fusion is added by `ALF', any other component of the table must be
##  added individually via `ARC( <identifier>, <compname>, <compval> )'.
##
##  `MOT' constructs a preliminary table record,
##  and puts it into the record `LIBTABLE.TABLEFILENAME'.
##  The `namesOfFusionSources' and `projections' are dealt with when the
##  table is constructed by `CharacterTableFromLibrary'.
##  Admissible names are notified by `ALN( <name>, <othernames> )'.
##
DeclareGlobalFunction( "MOT" );


#############################################################################
##
#V  GEN_Q_P
##
##  for prime powers <q>, at position <q> the unique prime divisor of <q>
##
#F  PrimeBase( <q> )  . . . . . . . . . . . . . . unique prime divisor of <q>
##
##  If <q> is a prime power, `PrimeBase' computes the prime of which it is
##  a power.  For the sake of speed, the results are stored
##  in the global list `GEN_Q_P'.
##
DeclareGlobalVariable( "GEN_Q_P",
    "list where the prime <p> is stored at position <p>^<n>, if bound" );

DeclareGlobalFunction( "PrimeBase" );


#############################################################################
##
##  3. Functions to construct library tables
##

#############################################################################
##
#F  LibInfoCharacterTable( <tblname> )
##
##  is a record with components
##  \beginitems
##  `firstName' &
##      the `Identifier' value (see~"ref:Identifier!for character tables"
##      in the {\GAP} Reference Manual) of the library table
##      for which <tblname> is an admissible name, and
##
##  `fileName' &
##      the name of the file in which the table data is stored.
##  \enditems
##  If no such table exists in the {\GAP} library then `fail' is returned.
##
##  If <tblname> contains the substring `\"mod\"' then it is regarded as the
##  name of a Brauer table.
##  In this case the result is computed from that for the corresponding
##  ordinary table and the characteristic.
##  So if the ordinary table exists then the result is a record although
##  the Brauer table in question need not be contained in the {\GAP} library.
##
DeclareGlobalFunction( "LibInfoCharacterTable" );


#############################################################################
##
#F  LibraryTables( <filename> )
##
##  is the list of data obtained on reading the file `<filename>.tbl'.
##  If the initial part of <filename> is one of `~/', `/' or `./' then the
##  file with this name is read; otherwise the name is interpreted relative
##  to the `data' directory of the `ctbllib' package.
##
DeclareGlobalFunction( "LibraryTables" );


#############################################################################
##
##  We replace the library function `CharacterTableFromLibrary' that just
##  issues a warning about nonavailability of the Character Table Library.
##
MakeReadWriteGlobal( "CharacterTableFromLibrary" );
UNBIND_GLOBAL( "CharacterTableFromLibrary" );


#############################################################################
##
#F  CharacterTableFromLibrary( <tblname> )
#F  CharacterTableFromLibrary( <series>, <param1>[, <param2>] )
##
##  If the only argument is a string <tblname> and if this is an admissible
##  name (see below) of a library character table then
##  `CharacterTableFromLibrary' returns this library table, otherwise `fail'.
##
##  If `CharacterTableFromLibrary' is called with more than one argument
##  then the first must be a string <series> specifying a series of groups
##  which is implemented via a generic character table,
##  for example `\"Symmetric\"' for symmetric groups;
##  the remaining arguments specialise then the desired member of the series
##  (see~"Generic Character Tables" for a list of available generic tables).
##  If no generic table with name <series> is available or if the parameters
##  are not admissible then `CharacterTableFromLibrary' returns `fail'.
##
##  A call of `CharacterTableFromLibrary' may cause to read some library
##  files and to construct the table object from the data stored in these
##  files,
##  so fetching a library table may take more time than on expects.
##
##  `CharacterTableFromLibrary' is called by `CharacterTable' if the first
##  argument is a string, so one may also call `CharacterTable'.
##
##  Admissible names for the *ordinary character table* $t$ of the group $G$
##  are
##  \beginlist
##  \item{-}
##      an {\ATLAS} like name if $t$ is an {\ATLAS} table
##      (see~"ATLAS Tables"), for example
##      `\"M22\"' for the table of the Mathieu group $M_{22}$,
##      `\"L2(13).2\"' for $L_2(13):2$, and
##      `\"12_1.U4(3).2_1\"' for $12_1\.U_4(3)\.2_1$,
##
##      (The difference to the name printed in the {\ATLAS} is that
##      subscripts and superscripts are omitted except if they are used to
##      qualify integer values,
##      and double dots are replaced by a single dot.)
##  \item{-}
##      the names that were admissible for tables of $G$ in {\sf CAS}
##      if the {\sf CAS} table library contained a table of $G$,
##      for example `sl42' for the table of the alternating group $A_8$,
##
##      (But note that the {\GAP} table may be different from that in
##      {\sf CAS}, see~"CAS Tables".)
##  \item{-}
##      some ``relative'' names, as follows.
##
##      If $G$ is the <n>--th maximal subgroup (in decreasing group order)
##      of a group whose library table $s$ is available in {\GAP} and stores
##      the `Maxes' value (see~"Maxes"),
##      and if <name> is an admissible name for $s$
##      then `<name>M<n>' is admissible for $t$.
##      For example, the name `\"J3M2\"' can be used to access the second
##      maximal subgroup of the sporadic simple Janko group $J_3$
##      which has the admissible name `J3'.
##
##      If $G$ is a nontrivial Sylow $p$ normalizer in a sporadic simple
##      group with admissible name <name>,
##      --where nontrivial means that $G$ is not isomorphic to a subgroup of
##      $p:(p-1)$--
##      then `<name>N<p>' is an admissible name of $t$.
##      For example, the name `\"J4N11\"' can be used to access the table of
##      the Sylow $11$ normalizer in the sporadic simple Janko group $J_4$.
##
##      In a few cases, the table of the Sylow $p$ subgroup of $G$ is
##      accessible via the name `<name>Syl<p>' where <name> is an admissible
##      name of the table of $G$.
##      For example, `\"A11Syl2\"' is an admissible name for the table of the
##      Sylow $2$ subgroup of the alternating group $A_{11}$.
##
##      In a few cases, the table of an element centralizer in $G$ is
##      accessible via the name `<name>C<cl>'
##      where <name> is an admissible name of the table of $G$.
##      For example, `\"M11C2\"' is an admissible name for the table of an
##      involution centralizer in the Mathieu group $M_{11}$.
##  \endlist
##
##  The recommended way to access *Brauer tables* from the library is via the
##  `mod' operator from the ordinary table and the desired characteristic
##  (see~"ref:BrauerTable" and "ref:Operators for Character Tables"
##  in the {\GAP} Reference Manual),
##  so it is not necessary to define admissible names of Brauer tables.
##
##  A *generic character table* (see~"Generic Character Tables") is
##  accessible only by the name given by its `Identifier' value
##  (see~"ref:Identifier!for character tables"
##  in the {\GAP} Reference Manual).
##
##  Case is not significant for character table names.
##  For example, both `\"suzm3\"' and `\"SuzM3\"' are admissible names for
##  the third maximal subgroup of the sporadic simple Suzuki group.
##
DeclareGlobalFunction( "CharacterTableFromLibrary" );


#############################################################################
##
#F  PartsBrauerTableName( <modname> )
##
##  is a record with components
##  `ordname'
##      substring up to the occurrence of `mod' in <modname>,
##  `prime'
##      the integer of the string after `mod'.
##
DeclareGlobalFunction( "PartsBrauerTableName" );


#############################################################################
##
#F  BasicSetBrauerTree( <brauertree> )
##
##  returns a basic set of the Brauer tree <brauertree>.
##  *Note* that this is a list of positions relative to the block, so it is
##  not compatible with the `basicset' components of blocks in Brauer tables.
##
DeclareGlobalFunction( "BasicSetBrauerTree" );


#############################################################################
##
#F  DecMatBrauerTree( <brauertree> )
##
##  In the {\GAP} table library, a Brauer tree <brauertree> is a list where
##  `<brauertree>[i]' contains the positions of `1' in the `i'-th column
##  of the decomposition matrix of the corresponding block.
##  So `<brauertree>[i]' has length 2 or 3 (in the case of exceptional
##  characters).
##
##  `DecMatBrauerTree' returns the decomposition matrix of the block with
##  given Brauer tree.
##
DeclareGlobalFunction( "DecMatBrauerTree" );


#############################################################################
##
#F  BrauerTree( <decmat> )
##
##  returns the Brauer tree of the decomposition matrix <decmat>, if exists,
##  and `fail' otherwise.
##
DeclareGlobalFunction( "BrauerTree" );


#############################################################################
##
#F  BrauerTableFromLibrary( <ordtbl>, <p> )
##
##  is the <p>-modular Brauer table of the ordinary library table <ordtbl>.
##
DeclareGlobalFunction( "BrauerTableFromLibrary" );


#############################################################################
##
#F  CharacterTableSpecialized( <generic_table>, <q> )  . . . . specialise <q>
##
##  For a record <generic_table> representing a generic character table,
##  and a parameter value <q>,
##  `CharacterTableSpecialized' returns a character table object computed by
##  evaluating <generic_table> at <q>.
##
DeclareGlobalFunction( "CharacterTableSpecialized" );


#############################################################################
##
#F  CharTableSpecialized( <gentbl>, <param> )
##
##  for compatibility with {\GAP}~3
##
DeclareSynonym( "CharTableSpecialized", CharacterTableSpecialized );


#############################################################################
##
##  4. Functions used as `construction' component of library tables
##
##  Note that in all construction functions, the table under construction is
##  a plain record, *not* a table object.
##

#############################################################################
##
#F  TransferComponentsToLibraryTableRecord( <t>, <tbl> )
##
##  <t> must be a library character table, and <tbl> a record that will be
##  converted to a library character table later.
##  `TransferComponentsToLibraryTableRecord' transfers all those values
##  from <t> to <tbl> that are described by `SupportedOrdinaryTableInfo'
##  and `SupportedLibraryTableComponents'.
##
DeclareGlobalFunction( "TransferComponentsToLibraryTableRecord" );


#############################################################################
##
#F  InducedLibraryCharacters( <subtbl>, <tblrec>, <chars>, <fusionmap> )
##
##  is the list of class function values lists
##
DeclareGlobalFunction( "InducedLibraryCharacters" );


#############################################################################
##
#F  UnpackedCll( <cll> )
##
##  is a record with the components `mat', `inertiagrps', `fusionclasses',
##  and perhaps `libname'.
##  These are the only components used in the construction of library
##  character tables encoded by Clifford matrices.
##
##  The meaning of <cll> is the same as in `CllToClf'.
##
DeclareGlobalFunction( "UnpackedCll" );


#############################################################################
##
#F  CllToClf( <tbl>, <cll> )
##
##  is a Clifford matrix for the table <tbl>.
##  It is constructed from the list <cll> that contains
##  the following entries.
##  1. list of indices of inertia factors
##  2. list of classes fusing in the factor group
##  3. identification of the matrix,
##     either unbound (then the matrix has dimension <= 2)
##     or a list containing
##       a. string `"elab"' or `"exsp"'
##       b. size of the Clifford matrix
##       c. index in the library file
##       d. (optional) necessary permutation of columns
##     or a list containing
##       a. the Clifford matrix itself and
##       b. the column weights.
##  4. (case `"exsp"') a list with items of record `splitinfos':
##       a. classindex
##       b. p
##       c. numclasses
##       d. root
##
DeclareGlobalFunction( "CllToClf" );


#############################################################################
##
##  5. Selection functions for the table library
##

#############################################################################
##
#F  CompleteGroup()
##
##  dummy function for selection function
##
DeclareGlobalFunction( "CompleteGroup" );


#############################################################################
##
#F  OfThose()
##
##  dummy function for selection function
##
DeclareGlobalFunction( "OfThose" );


#############################################################################
##
#V  FingerprintOfCharacterTableGlobals
##
##  a list of lists of names of functions
#T admit extensions by users
#T check that the values are valid
#T (`InstallFingerprintFunctionOfCharacterTable')
##
DeclareGlobalVariable( "FingerprintOfCharacterTableGlobals" );

InstallFlushableValue( FingerprintOfCharacterTableGlobals,
    [ [ "Size" ],
      [ "NrConjugacyClasses" ],
      [ "IsSimpleCharacterTable" ],
      [ "OrdersClassRepresentatives", "Collected" ],
      [ "SizesCentralizers", "Collected" ],
    ] );


#############################################################################
##
#A  FingerprintOfCharacterTable( <tbl> )
##
##  a record whose components are  ...
##
DeclareAttribute( "FingerprintOfCharacterTable", IsOrdinaryTable );

InstallMethod( FingerprintOfCharacterTable,
    [ IsOrdinaryTable ],
    function( tbl )
    local result, list, val, name;

    result:= rec();

    for list in FingerprintOfCharacterTableGlobals do
      val:= tbl;
      for name in list do
        val:= ValueGlobal( name )( val );
      od;
      result.( String( list ) ):= val;
    od;

    return result;
    end );


#############################################################################
##
#F  AllCharacterTableNames( [<func>, <val>, ... ] )
#F  AllCharacterTableNames( <func>, <val>, ...[, OfThose, <func>] )
##
##  Similar to group libraries (see Chapter~"ref:Group Libraries" in the
##  {\GAP} Reference Manual),
##  the {\GAP} character table library can be used to search for ordinary
##  character tables with prescribed properties.
##
##  A specific library table can be selected by an admissible name
##  (see~"CharacterTableFromLibrary").
##
##  The selection function for character tables from the {\GAP} Character
##  Table Library that have certain abstract properties is
##  `AllCharacterTableNames'.
##  Contrary to the situation in the case of group libraries,
##  the selection function returns a list not of library character tables
##  but of their names;
##  using `CharacterTable' one can then access the tables themselves.
##
##  `AllCharacterTableNames' takes an arbitrary even number of arguments.
##  The argument at each odd position must be a function, and
##  the argument at the subsequent even position must be a value that this
##  function must return when called for the character table in question,
##  in order to have the name of the table included in the selection,
##  or a list of such values.
##  For example,
##  \beginexample
##  gap> names:= AllCharacterTableNames();;
##  \endexample
##  returns a list containing one admissible name of each ordinary character
##  table in the {\GAP} library, and
##  \beginexample
##  gap> simpnames:= AllCharacterTableNames( IsSimple, true );;
##  gap> AllCharacterTableNames( IsSimple, true, Size, [ 1 .. 100 ] );
##  [ "A5" ]
##  \endexample
##  return lists containing an admissible name of each ordinary character
##  table in the {\GAP} library whose groups are simple or are simple and
##  have order at most $100$, respectively.
##
##  For the sake of efficiency,
##  the arguments `IsSimple' and `IsSporadicSimple' followed by `true' are
##  handled in a special way, {\GAP} need not read all files of the table
##  library in these cases in order to find the desired names.
##
##  If the function `OfThose' is an argument at an odd position then the
##  following argument <func> must be a function that takes a character table
##  and returns a name of a character table or a list of names;
##  this is interpreted as replacement of the names computed up to this
##  position by the union of names returned by <func>.
##  For example, <func> may be `Maxes' (see~"Maxes") or
##  `NamesOfFusionSources' (see~"ref:NamesOfFusionSources" in the {\GAP}
##  Reference Manual).
##  \beginexample
##  gap> maxesnames:= AllCharacterTableNames( IsSporadicSimple, true,
##  >                                         HasMaxes, true,
##  >                                         OfThose, Maxes );;
##  \endexample
##  returns the union of names of ordinary tables of those maximal subgroups
##  of sporadic simple groups that are contained in the table library in the
##  sense that the attribute `Maxes' is set.
##
##  For the sake of efficiency, `OfThose' followed by one of the arguments
##  `AutomorphismGroup', `SchurCover', `CompleteGroup' is handled in a
##  special way.
##
DeclareGlobalFunction( "AllCharacterTableNames" );


#############################################################################
##
#F  OneCharacterTableName( {<func>, <val>} )
#F  OneCharacterTableName( <func>, <val>, ...{, OfThose, <func>} )
##
##  The example function for character tables from the {\GAP} Character
##  Table Library that have certain abstract properties is
##  `OneCharacterTableName'.
##  It is analogous to the selection function `AllCharacterTableNames'
##  (see~"AllCharacterTableNames"), the difference is that it returns one
##  `Identifier' value of a character table with the properties in question
##  instead of the list of all such values.
##  If no table with the required properties is contained in the {\GAP}
##  Character Table Library then `fail' is returned.
##  \beginexample
##  gap> OneCharacterTableName( IsSimple, true, Size, 60 );
##  "A5"
##  gap> OneCharacterTableName( IsSimple, true, Size, 20 );
##  fail
##  \endexample
##
DeclareGlobalFunction( "OneCharacterTableName" );


#############################################################################
##
#F  AllCharTableNames( ... )
##
##  for compatibility with {\GAP}~3
##
DeclareSynonym( "AllCharTableNames", AllCharacterTableNames );


#############################################################################
##
#F  CTblLibSetUnload( <value> )
##
##  If <value> is `false' then the call to `CTblLibSetUnload' has the effect
##  that data files from the {\GAP} Character TableLibrary are read only once
##  in the current session.
##  By default, the contents of only one data file is kept in memory,
##  in order to keep the space small.
##  This behaviour can be achieved also by calling `CTblLibSetUnload' with
##  `true'.
##
DeclareGlobalFunction( "CTblLibSetUnload" );


#############################################################################
##
##  6. Functions to produce tables in library format
##

#############################################################################
##
#F  ShrinkClifford( <tbl> )
##
##  shrinks the `cliffordTable' component.
##  The Clifford records are changed to library format using `ClfToCll'.
##  In the library format, only the component `ident' of the inertia factor
##  groups are stored.
##
DeclareGlobalFunction( "ShrinkClifford" );


#############################################################################
##
#F  TextString( <text> )
##
##  returns a string that is printed as
##
##  [
##  "<line_1>\n",
##  "<line_1>\n",
##  ...
##  "<line_n>"
##  ]
##
##  where <line_i> is the <i>-th line of the output of `Print( <text> )',
##  except that the doublequotes are escaped.
##
##  *Note* that the `]' is the last output character.
##
DeclareGlobalFunction( "TextString" );


#############################################################################
##
#F  BlanklessPrintTo( <stream>, <obj> )
##
##  appends <obj> to the output stream <stream>,
##  thereby trying to avoid unnecessary blanks.
##  For the subobjects of <obj>, the function `PrintTo' is used.
##  (So the subobjects are appended only if <stream> is of the appropriate
##  type, see~"PrintTo".)
##
##  If <obj> is a record then the component `text' and strings in an `irr'
##  list are *not* treated in a special way!
##
##  This function is used by the libraries of character tables and of tables
##  of marks.
##
DeclareGlobalFunction( "BlanklessPrintTo" );
#T better use WriteAll?


#############################################################################
##
#F  ShrinkChars( <chars> )
##
##  returns the list corresponding to the list <chars> where
##
##  each `<chars>[<k>]' that is the tensor product of `<chars>[<i>]'
##  and a linear character `<chars>[j]' with $i, j \leq k$ is replaced by
##  the string `\"[TENSOR,[<i>,<j>]]\"', and
##
##  each `<chars>[<k>]' that is the <j>-th Galois conjugate of `<chars>[<i>]'
##  with $i \leq k$ is replaced by the string `\"[GALOIS,[<i>,<j>]]\"'.
##
##  This function is used by `PrintToLib'.
##
DeclareGlobalFunction( "ShrinkChars" );


#############################################################################
##
#F  ClfToCll( <clf> )
##
##  is a list encoding the information in the Clifford matrix record <clf>.
##  <clf> must contain the components `mat', `inertiagrps', `fusionclasses'.
##
##  See `CllToClf' for the meaning of the entries.
##
DeclareGlobalFunction( "ClfToCll" );
#T up to now no function is installed


#############################################################################
##
#F  LibraryFusion( <name>, <fus> )
##
##  For a string <name> that is an `Identifier' value
##  (see~"ref:Identifier!for character tables" in the {\GAP} Reference
##  Manual) of an ordinary character table in the {\GAP} library,
##  and a record <fus> with the components
##  `name' (the identifier of the destination table, or this table itself),
##  `map' (the fusion map, a list of image positions),
##  and optionally `text' (a string containing information about the fusion)
##  and `specification' (a string or an integer),
##  `LibraryFusion' returns a string whose printed value can be used to add
##  the fusion in question to the library file containing the data for the
##  table with identifier <name>.
##
##  <name> may also be a character table, in this case its `Identifier' value
##  is used as string.
##
DeclareGlobalFunction( "LibraryFusion" );


#############################################################################
##
#F  LibraryFusionTblToTom( <name>, <fus> )
##
##  For a string <name> that is an `Identifier' value
##  (see~"ref:Identifier!for character tables" in the {\GAP} Reference
##  Manual) of an ordinary character table in the {\GAP} library,
##  and a record <fus> with components `name' (the identifier of the
##  destination table of marks), `map' (the fusion map, a list of image
##  positions), and optionally `text' (a string containing information about
##  the fusion), `LibraryFusionTblToTom' returns a string whose printed value
##  can be used to add the fusion in question to the character table library
##  file containing the data for the table with identifier <name>.
##
##  <name> may also be a character table, in this case its `Identifier' value
##  is used as string.
##
DeclareGlobalFunction( "LibraryFusionTblToTom" );


#############################################################################
##
#F  PrintToLib( <file>, <tbl> )
##
##  prints the (ordinary or Brauer) character table <tbl> in library format
##  to the file `<file>.tbl' or <file>
##  (if this has already the suffix `.tbl'), respectively.
##
##  If <tbl> is an ordinary table then the value of the attribute
##  `NamesOfFusionSources' is ignored by `PrintToLib',
##  since for library tables this information is extracted from the source
##  files by the `maketbl' script.
##
DeclareGlobalFunction( "PrintToLib" );


#############################################################################
##
#F  PrintClmsToLib( <file>, <clms> )
##
##  prints the Clifford matrices in library format in a list on the file
##  <file> which are not yet in the Clifford matrix library or in this list.
##
##  <clms> must be a Clifford table or a list of Clifford records.
##  In case of splitting, each Clifford record must contain `splitinfos'.
##
DeclareGlobalFunction( "PrintClmsToLib" );
#T up to now no function is installed


#############################################################################
##
#F  OrbitsResidueClass( <pq>, <set> )
##
##  is used in the generic character table of the groups $p \colon q$.
##  <pq> must be a list of length $2$ or $3$, the first entry being $p$,
##  the second being $q$, and the third (if bound) being the residue $k$
##  (modulo $p$) that forms orbits of length $q$ each on the nonzero
##  residues modulo $p$.
##  <set> is the set of points to act on.
##
DeclareGlobalFunction( "OrbitsResidueClass" );


#############################################################################
##
#A  CASInfo( <tbl> )
##
##  Let <tbl> be an ordinary character table <tbl> in the {\GAP} library
##  that was (up to permutations of classes and characters) contained already
##  in the {\sf CAS} table library.
##  When one fetches <tbl> from the library, one does in general not get the
##  original {\sf CAS} table.
##  Namely, in many cases (mostly {\ATLAS} tables, see~"ATLAS Tables")
##  the identifier of the table (see~"ref:Identifier!for character tables"
##  in the {\GAP} Reference Manual) as well as the ordering of classes and
##  characters are different for the {\sf CAS} table and its {\GAP} version.
##
##  Note that in several cases, the {\sf CAS} library contains different
##  tables of the same group,
##  in particular these tables may have different names and orderings of
##  classes and characters.
##
##  The `CASInfo' value of <tbl>, if stored, is a list of records,
##  each describing the relation between <tbl> and a character table in the
##  {\sf CAS} library.
##  The records have the components
##  \beginitems
##  `name' &
##      the name of the {\sf CAS} table,
##
##  `permchars' and `permclasses' &
##      permutations of the `Irr' values and the classes of <tbl>,
##      respectively, that must be applied in order to get the orderings in
##      the original {\sf CAS} table, and
##
##  `text' &
##      the text that was stored on the {\sf CAS} table
##      (which may contain incorrect statements).
##  \enditems
##
DeclareAttributeSuppCT( "CASInfo", IsNearlyCharacterTable,
    [ "class", "character" ] );


#############################################################################
##
#A  Maxes( <tbl> )
##
##  is a list of identifiers of the tables of all maximal subgroups of <tbl>.
##  This is meaningful only for library tables,
##  and there is no default method to compute the value.
##
##  If the `Maxes' value of <tbl> is stored then it lists exactly one
##  representative for each conjugacy class of maximal subgroups of the group
##  of <tbl>,
##  and the tables of these maximal subgroups are available in the {\GAP}
##  table library, and the fusions to <tbl> are stored on these tables.
##
DeclareAttributeSuppCT( "Maxes", IsNearlyCharacterTable, [] );


#############################################################################
##
#A  ConstructionInfoCharacterTable( <tbl> )
##
##  If this attribute is set for an ordinary character table <tbl> then
##  the value is a list that describes how this table was constructed.
##  The first entry is a string that is the identifier of the function that
##  was applied to the pre-table record; the remaining entries are the
##  arguments for that functions, except that the pre-table record must be
##  prepended to these arguments.
#T should this be available also for other tables than library tables?
#T (direct products of tables with groups and library tables etc.)
#T and if it is a `SuppCT' attribute then should row/column permutations
#T be always optional arguments to be applied after the constuction?
##
DeclareAttributeSuppCT( "ConstructionInfoCharacterTable",
    IsNearlyCharacterTable, [] );


#############################################################################
##
#A  FusionToTom( <tbl> )
##
##  If this attribute is set for an ordinary character table <tbl> then
##  the {\GAP} Library of Tables of Marks contains the table of marks of the
##  group of <tbl>, and the attribute value is a record with the following
##  components.
##  \beginitems
##  `name' &
##      the `Identifier' component of the table of marks of <tbl>,
##
##  `map' &
##      the fusion map, and
##
##  `text' (optional) &
##      a string describing the status of the fusion.
##  \enditems
##
DeclareAttributeSuppCT( "FusionToTom", IsNearlyCharacterTable, [ "class" ] );


#############################################################################
##
#A  ProjectivesInfo( <tbl> )
##
##  If this attribute is set for an ordinary character table <tbl> then
##  the value is a list of records, each with the following components.
##  \beginitems
##  `name' &
##      the `Identifier' value of the character table <mult> of the covering
##      whose faithful irreducible characters are described by the record,
##
##  `chars' &
##      a list of values lists of faithful projective irreducibles;
##      only one representative of each family of Galois conjugates is
##      contained in this list,
##      and
##
##  `map' &
##      a list of positions that maps each class of <tbl> to that preimage in
##      <mult> for which the entries in `chars' give the values.
##      In a sense, a projection map is an inverse of the factor fusion from
##      the table of the covering to the given table
##      (see~"ref:ProjectionMap" in the {\GAP} Reference Manual).
##  \enditems
##
DeclareAttributeSuppCT( "ProjectivesInfo", IsNearlyCharacterTable,
    [ "class" ] );


#############################################################################
##
#A  ExtensionInfoCharacterTable( <tbl> )
##
##  Let <tbl> be the ordinary character table of a group $G$, say.
##  If this attribute is set for <tbl> then the value is a list of length
##  two,
##  the first entry being a string <M> that describes the Schur multiplier
##  of $G$ and the second entry being a string <A> that describes the outer
##  automorphism group of $G$.
##  Trivial multiplier or outer automorphism group are denoted by an empty
##  string.
##
##  If <tbl> is a table from the {\GAP} Character Table Library and $G$ is
##  (nonabelian and) simple then the value is set.
##  In this case, an admissible name for the character table of the
##  Darstellungsgruppe of $G$ (if this table is available and different from
##  <tbl>) is given by the concatenation of <M>, `"."', and the `Identifier'
##  value of <tbl>.
##  Analogously, an admissible name for the character table of the
##  automorphism group of $G$ (if this table is available and different from
##  <tbl>) is given by the concatenation of the `Identifier' value of <tbl>,
##  `"."', and <A>.
##
DeclareAttributeSuppCT( "ExtensionInfoCharacterTable",
    IsNearlyCharacterTable, [] );


#############################################################################
##
#F  GaloisPartnersOfIrreducibles( <tbl>, <characters>, <n> )
##
DeclareGlobalFunction( "GaloisPartnersOfIrreducibles" );


#############################################################################
##
#F  AtlasLabelsOfIrreducibles( <tbl>[, "short"] )
##
##  Let <tbl> be the (ordinary or Brauer) character table of a bicyclic
##  extension of a simple group that occurs in the
##  {\ATLAS} of Finite Groups~\cite{CCN85} or the
##  {\ATLAS} of Brauer Characters~\cite{JLPW95}.
##  `AtlasLabelsOfIrreducibles' returns a list of strings, the $i$-th entry
##  being a label for the $i$-th irreducible character of <tbl>.
##
##  The labels have the following form.
##  We state the rules only for ordinary characters,
##  the rules for Brauer characters are obtained by replacing $\chi$
##  by $\varphi$.
##
##  First consider only downward extensions $m\.G$ of a simple group $G$.
##  If $m \leq 2$ then only labels of the form $\chi_i$ occur,
##  which denotes the $i$-th ordinary character shown in the {\ATLAS}.
##
##  The labels of faithful ordinary characters of groups $m\.G$ with $m\geq 3$
##  are of the form $\chi_i$, $\chi_i^{\ast}$, or $\chi_i^{\ast k}$,
##  which means the $i$-th character printed in the {\ATLAS},
##  the unique character that is not printed and for which $\chi_i$ acts as
##  proxy
##  (see~Sections~8 and~19 of Chapter~7 in the {\ATLAS} of Finite Groups),
##  and the image of the printed character $\chi_i$ under the algebraic
##  conjugacy operator $\ast k$, respectively.
##
##  For groups $m\.G\.a$ with $a > 1$, the labels of the irreducible characters
##  are derived from the labels of the irreducible constituents of their
##  restrictions to $m\.G$, as follows.
##  \beginlist
##  \item{1.}
##      If the ordinary irreducible character $\chi_i$ of $m\.G$ extends to
##      $m\.G\.a$ then the $a^{\prime}$ extensions are denoted by
##      $\chi_{i,0}, \chi_{i,1}, \ldots, \chi_{i,a^{\prime}}$,
##      where $\chi_{i,0}$ is the character whose values are printed in the
##      {\ATLAS}.
##  \item{2.}
##      The label $\chi_{i_1 + i_2 + \cdots + i_a}$ means that $a$ different
##      characters $\chi_{i_1}, \chi_{i_2}, \ldots, \chi_{i_a}$ of $m\.G$
##      induce to an irreducible character of $m\.G\.a$ with this label.
##
##      If the string `\"short\"' was entered as the second argument then the
##      label has the short form $\chi_{i_1+}$.
##      Note that $i_2, i_3, \ldots, i_a$ can be read off from the
##      fusion signs in the {\ATLAS}.
##  \item{3.}
##      Finally, the label
##      $\chi_{i_1,j_1 + i_2,j_2 + \cdots + i_{a^{\prime}},j_{a^{\prime}}}$
##      means that the characters
##      $\chi_{i_1}, \chi_{i_2}, \ldots, \chi_{i_{a^{\prime}}}$ of $m\.G$
##      extend to a group that lies properly between $m\.G$ and $m\.G\.a$,
##      and the extensions $\chi_{i_1,j_1}, \chi_{i_2,j_2}, \ldots
##      \chi_{i_{a^{\prime}},j_{a^{\prime}}}$
##      induce to an irreducible character of $m\.G\.a$ with this label.
##
##      Again, if the string `\"short\"' was entered as the second argument
##      then the label has a short form, namely $\chi_{i,j+}$.
##  \endlist
##
DeclareGlobalFunction( "AtlasLabelsOfIrreducibles" );


#############################################################################
##
#F  NameOfLibraryCharacterTable( <tomname> )
##
##  This function is used in the interface between the {\GAP} libraries of
##  character tables and of tables of marks.
##  If the table of marks with the name <tomname> has been notified as the
##  table of marks of a {\GAP} library character table (in the sense that the
##  `name' component of the `FusionToTom' (see~"FusionToTom") value of the
##  character table is set to <tomname>) then the return value is an
##  admissible name of this character table.
##  Otherwise `fail' is returned.
##
DeclareGlobalFunction( "NameOfLibraryCharacterTable" );


#############################################################################
##
#E