GAP 4.8.9 installation with standard packages -- copy to your CoCalc project to get it
\Chapter{What is XGAP?}12In this chapter you find the answer to the above question beginning from a3short overview up to a description of the technical concept.45%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%6\Section{Basics}78The idea of \XGAP~is that \GAP~should be able to control graphics. A9graphical user interface is sometimes easier to use than a text and10command oriented one and there are mathematical applications for which it11can be quite useful to visualize objects with computer graphics.1213On the other hand it is not sensible to change the whole concept and user14interface of {\GAP} because it is not advisable to put all the facilities of15{\GAP} into a menu system. So \XGAP~is a separate C program running under the16X Window System, which starts up a \GAP~job and allows normal command17execution within a window. Note that the online help of {\GAP} is18available, however it will appear in a separate window.1920In addition there is a library written in \GAP, which makes it21possible to open new windows, display graphics, control menus and do22other graphical user communication in \GAP~via the separate C part.2324Built on those ``simple'' windows and graphic objects are other libraries25which display graphs and posets in a window and allow the user to move26vertices around, select them and invoke \GAP~functions on mathematical27objects which belong to the graphic objects.2829One ``application'' of these libraries is a program to display subgroup30lattices interactively. So \XGAP~works as a front end for mathematical31operations on subgroup lattices. It is possible to ``switch'' between the32graphics and the \GAP~commands. This means that you can for example use the33graphically selected vertices resp. subgroups to do your own calculations34in the command window. You can then display your results again as vertices35in the lattice.3637Of course there are other applications possible and the libraries are38developed with code reusage in mind.3940%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%41\Section{What you can do with XGAP}4243{\XGAP} graphic sheets work graphic object oriented. This means that the44basic graphic objects are not pixels but lines, rectangles, circles and so45on. Although technically everything on the screen consists of pixels46{\XGAP} remembers the structure of your graphics via higher objects. This47has advantages as well as disadvantages. Do not expect to be able to48place pixel images into your {\XGAP} graphic sheets. That is as of now49*not possible* with {\XGAP} and probably will never be, because it is not50the idea of the design.5152What you can do is create, move around and change lines, circles, text and53so forth in graphic sheets. Your programs can communicate with the user via54graphical user interfaces like mouse, menus, dialogs, and so on.5556It is very easy to link this graphical environment with your programs in57the mathematical environment of {\GAP}. So you can very quickly implement58visualizations of the mathematical objects you study. The user can select59objects, choose functions from menus and ask for more information with a60few mouse clicks.6162A good example for this approach is the implementation of the interactive63Todd-Coxeter-Algorithm to compute coset tables in finitely presented64groups. It uses the graphical features of {\XGAP} to give the user quick65and easy access to the algorithm by a few mouse clicks. This program was66written by Ludger Hippe in Aachen using {\XGAP3} and is currently ported to67{\XGAP4} and extended by Volkmar Felsch.6869Another nice little example is in the `examples' subdirectory in the70{\XGAP} distribution. It was written by Thomas Breuer (Aachen) to71demonstrate the features of {\XGAP}. The user gets a small window with a72puzzle and can solve it using the mouse. You can test this example by73starting {\XGAP} and `Read'ing the file `pkg/xgap/examples/puzzle.g'.74You can do this by using7576\begintt77gap> ReadPkg("xgap","examples/puzzle.g");78gap> p := Puzzle(4,4);79\endtt8081You do not have to invent the wheel many times. For certain mathematical82concepts like graphs, posets or lattices {\XGAP} provides implementations83which can84be adapted to your special situation. You can use those parts of the code85you like and substitute the other parts to adapt the behaviour of the user86interface to your wishes.878889%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%90\Section{How does it work?}9192{\XGAP} consists of a C program `xgap' (in the following `xgap' in93typewriter style refers to this C part) separate from {\GAP}, and of some94libraries written in the {\GAP} language. `xgap' is started by the95user and launches a {\GAP} job in the background. It then talks96to this {\GAP} job. Especially it displays all the output which comes from97{\GAP} in the communication window and feeds everything the user types in98this window into the {\GAP} job.99100But there is also some communication with the {\GAP} job about the graphics101that should be displayed. Because {\GAP} has no concept of putting graphics102on the screen, this part is done by `xgap'. Therefore there is a protocol103between the {\GAP} part of {\XGAP} running in the {\GAP} session and `xgap'104which is embedded in the input/output stream. The user does not notice105this. `xgap' stores all windows and graphic objects and does all the work106necessary for displaying windows and managing user communication and so on.107108The {\GAP} part of {\XGAP} also stores all graphical information, but in109form of {\GAP} objects. The user can inspect all these structures and use110them in own programs. Changes in these structures are transmitted through111the communications protocol to `xgap' and are eventually displayed on the112screen. User actions like mouse clicks or keyboard events are caught by113`xgap' and transmitted to the {\GAP} job via function calls that are114``typed in'' as if the user had typed them. So the library can work on them115and change the {\GAP} objects accordingly.116117Technically, {\XGAP} is a package and one of the first commands that118is executed automatically within the {\GAP} session is a119`LoadPackage("xgap")' call. This reads in the extra {\XGAP}120libraries. They are found in the `pkg/xgap/lib' subdirectory, normally in the121main {\GAP} directory. The files contain the following:122123\beginitems124`window.g' & basic definitions for the communications protocol125126`sheet.g[di]' & graphic sheets and their operations127128`color.g[di]' & color information129130`font.g[di]' & text font information131132`menu.g[di]' & menus, dialogs, popups, and user communication133134`gobject.g[di]'& low level graphic objects and their operations135136`poset.g[di]' & graphic graphs and graphic posets137138`ilatgrp.g[di]'& graphic subgroup lattices139140`meataxe.g[di]'& support to display submodule lattices calculated within141the C MeatAxe142\enditems143144The user normally does not need to know this or the details of it. However,145it is important to understand that the program `xgap' is highly machine or146at least operating system dependent. There is no generic way to access147graphics across different platforms up to now. {\XGAP} should run on all148variants of Unix with the X Window System Version 11 Release 5 or149higher. As of now {\XGAP} does not run on Microsoft Windows. It is150also definitely *not* easily ported there, because some important features151that are used within {\XGAP} are missing there (such as pseudo terminals).152There are currently no plans underways to do work in this direction.153154%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%155\Section{Historical Remarks and Acknowledgements}156157A first program for drawing a diagram showing the lattice of subgroups158of a finite group that had been calculated by a computer was159implemented by H. J\accent127urgensen in 1965 (see \cite{FJ65}).160% [quote K. Ferber, H. Juergensen,161%A programme for drawing a lattice. p. 83 - 86 of J. Leech,162%ed. Computational Problems in Abstract Algebra, 1970]163164The design of {\XGAP} was strongly influenced and in fact triggered by165the QUOTPIC system of Derek Holt and Sarah Rees (see \cite{HR91})166%[quote D.Holt, S.167%Rees, A Graphics System for Displaying Finite Quotients of Finitely168%Presented Groups p. 113 - 126 of L. Finkelstei, W.M. Kantor, Groups169%and Computation, DIMACS 1991]170%171which allows to depict graphically knowledge about normal subgroups of172a finitely presented group found by a variety of methods for the173investigation of finitely presented groups. It seemed most desirable174to allow to depict in a similar way the even wider variety of175information on subgroups of groups that can be obtained by a system176such as {\GAP}.177178Beginning 1993, Frank Celler developed the idea of an interface from179{\GAP} to graphic systems that allowed to actually write commands for180graphical tasks in the {\GAP} language and together with Susanne181Keitemeier (see \cite{SK95}) wrote a first version182of programs in {\XGAP} for drawing diagrams representing posets of183subgroups of finite and finitely presented groups. We most gratefully184acknowledge the help of Sarah Rees in implementing the interactive185lattice functions and in beta testing the {\GAP3} version of {\XGAP}.186187In 1998, Thomas Breuer, Frank Celler, Joachim Neub\accent127user and Max188Neunh\accent127offer planned the new concepts for the {\GAP4}189version. The implementation and porting to {\GAP4} was done mainly by Max190Neunh\accent127offer in 1998 and 1999. Michael Ringe added the link to his191MeatAxe programs. We like to thank all those who have adapted the {\GAP}192library to the needs of the new {\XGAP}, in particular Alexander Hulpke who193has been extremely helpful with this task.194195196197