<html><head><title>[XGAP] 2 What is XGAP?</title></head> <body text="#000000" bgcolor="#ffffff"> [<a href = "chapters.htm">Up</a>] [<a href ="CHAP001.htm">Previous</a>] [<a href ="CHAP003.htm">Next</a>] [<a href = "theindex.htm">Index</a>] <h1>2 What is XGAP?</h1><p> <P> <H3>Sections</H3> <oL> <li> <A HREF="CHAP002.htm#SECT001">Basics</a> <li> <A HREF="CHAP002.htm#SECT002">What you can do with XGAP</a> <li> <A HREF="CHAP002.htm#SECT003">How does it work?</a> <li> <A HREF="CHAP002.htm#SECT004">Historical Remarks and Acknowledgements</a> </ol><p> <p> In this chapter you find the answer to the above question beginning from a short overview up to a description of the technical concept. <p> <p> <h2><a name="SECT001">2.1 Basics</a></h2> <p><p> The idea of XGAP is that <font face="Gill Sans,Helvetica,Arial">GAP</font> should be able to control graphics. A graphical user interface is sometimes easier to use than a text and command oriented one and there are mathematical applications for which it can be quite useful to visualize objects with computer graphics. <p> On the other hand it is not sensible to change the whole concept and user interface of <font face="Gill Sans,Helvetica,Arial">GAP</font> because it is not advisable to put all the facilities of <font face="Gill Sans,Helvetica,Arial">GAP</font> into a menu system. So XGAP is a separate C program running under the X Window System, which starts up a <font face="Gill Sans,Helvetica,Arial">GAP</font> job and allows normal command execution within a window. Note that the online help of <font face="Gill Sans,Helvetica,Arial">GAP</font> is available, however it will appear in a separate window. <p> In addition there is a library written in <font face="Gill Sans,Helvetica,Arial">GAP</font>, which makes it possible to open new windows, display graphics, control menus and do other graphical user communication in <font face="Gill Sans,Helvetica,Arial">GAP</font> via the separate C part. <p> Built on those ``simple'' windows and graphic objects are other libraries which display graphs and posets in a window and allow the user to move vertices around, select them and invoke <font face="Gill Sans,Helvetica,Arial">GAP</font> functions on mathematical objects which belong to the graphic objects. <p> One ``application'' of these libraries is a program to display subgroup lattices interactively. So XGAP works as a front end for mathematical operations on subgroup lattices. It is possible to ``switch'' between the graphics and the <font face="Gill Sans,Helvetica,Arial">GAP</font> commands. This means that you can for example use the graphically selected vertices resp. subgroups to do your own calculations in the command window. You can then display your results again as vertices in the lattice. <p> Of course there are other applications possible and the libraries are developed with code reusage in mind. <p> <p> <h2><a name="SECT002">2.2 What you can do with XGAP</a></h2> <p><p> XGAP graphic sheets work graphic object oriented. This means that the basic graphic objects are not pixels but lines, rectangles, circles and so on. Although technically everything on the screen consists of pixels XGAP remembers the structure of your graphics via higher objects. This has advantages as well as disadvantages. Do not expect to be able to place pixel images into your XGAP graphic sheets. That is as of now <strong>not possible</strong> with XGAP and probably will never be, because it is not the idea of the design. <p> What you can do is create, move around and change lines, circles, text and so forth in graphic sheets. Your programs can communicate with the user via graphical user interfaces like mouse, menus, dialogs, and so on. <p> It is very easy to link this graphical environment with your programs in the mathematical environment of <font face="Gill Sans,Helvetica,Arial">GAP</font>. So you can very quickly implement visualizations of the mathematical objects you study. The user can select objects, choose functions from menus and ask for more information with a few mouse clicks. <p> A good example for this approach is the implementation of the interactive Todd-Coxeter-Algorithm to compute coset tables in finitely presented groups. It uses the graphical features of XGAP to give the user quick and easy access to the algorithm by a few mouse clicks. This program was written by Ludger Hippe in Aachen using XGAP3 and is currently ported to XGAP4 and extended by Volkmar Felsch. <p> Another nice little example is in the <code>examples</code> subdirectory in the XGAP distribution. It was written by Thomas Breuer (Aachen) to demonstrate the features of XGAP. The user gets a small window with a puzzle and can solve it using the mouse. You can test this example by starting XGAP and <code>Read</code>ing the file <code>pkg/xgap/examples/puzzle.g</code>. You can do this by using <p> <pre> gap> ReadPkg("xgap","examples/puzzle.g"); gap> p := Puzzle(4,4); </pre> <p> You do not have to invent the wheel many times. For certain mathematical concepts like graphs, posets or lattices XGAP provides implementations which can be adapted to your special situation. You can use those parts of the code you like and substitute the other parts to adapt the behaviour of the user interface to your wishes. <p> <p> <h2><a name="SECT003">2.3 How does it work?</a></h2> <p><p> XGAP consists of a C program <code>xgap</code> (in the following <code>xgap</code> in typewriter style refers to this C part) separate from <font face="Gill Sans,Helvetica,Arial">GAP</font>, and of some libraries written in the <font face="Gill Sans,Helvetica,Arial">GAP</font> language. <code>xgap</code> is started by the user and launches a <font face="Gill Sans,Helvetica,Arial">GAP</font> job in the background. It then talks to this <font face="Gill Sans,Helvetica,Arial">GAP</font> job. Especially it displays all the output which comes from <font face="Gill Sans,Helvetica,Arial">GAP</font> in the communication window and feeds everything the user types in this window into the <font face="Gill Sans,Helvetica,Arial">GAP</font> job. <p> But there is also some communication with the <font face="Gill Sans,Helvetica,Arial">GAP</font> job about the graphics that should be displayed. Because <font face="Gill Sans,Helvetica,Arial">GAP</font> has no concept of putting graphics on the screen, this part is done by <code>xgap</code>. Therefore there is a protocol between the <font face="Gill Sans,Helvetica,Arial">GAP</font> part of XGAP running in the <font face="Gill Sans,Helvetica,Arial">GAP</font> session and <code>xgap</code> which is embedded in the input/output stream. The user does not notice this. <code>xgap</code> stores all windows and graphic objects and does all the work necessary for displaying windows and managing user communication and so on. <p> The <font face="Gill Sans,Helvetica,Arial">GAP</font> part of XGAP also stores all graphical information, but in form of <font face="Gill Sans,Helvetica,Arial">GAP</font> objects. The user can inspect all these structures and use them in own programs. Changes in these structures are transmitted through the communications protocol to <code>xgap</code> and are eventually displayed on the screen. User actions like mouse clicks or keyboard events are caught by <code>xgap</code> and transmitted to the <font face="Gill Sans,Helvetica,Arial">GAP</font> job via function calls that are ``typed in'' as if the user had typed them. So the library can work on them and change the <font face="Gill Sans,Helvetica,Arial">GAP</font> objects accordingly. <p> Technically, XGAP is a package and one of the first commands that is executed automatically within the <font face="Gill Sans,Helvetica,Arial">GAP</font> session is a <code>RequirePackage("xgap")</code> call. This reads in the extra XGAP libraries. They are found in the <code>pkg/xgap/lib</code> subdirectory, normally in the main <font face="Gill Sans,Helvetica,Arial">GAP</font> directory. The files contain the following: <p> <p> <dl compact> <dt><code>window.g</code> <dd> basic definitions for the communications protocol <p> <dt><code>sheet.g[di]</code> <dd> graphic sheets and their operations <p> <dt><code>color.g[di]</code> <dd> color information <p> <dt><code>font.g[di]</code> <dd> text font information <p> <dt><code>menu.g[di]</code> <dd> menus, dialogs, popups, and user communication <p> <dt><code>gobject.g[di]</code><dd> low level graphic objects and their operations <p> <dt><code>poset.g[di]</code> <dd> graphic graphs and graphic posets <p> <dt><code>ilatgrp.g[di]</code><dd> graphic subgroup lattices <p> <dt><code>meataxe.g[di]</code><dd> support to display submodule lattices calculated within the C MeatAxe </dl> <p> The user normally does not need to know this or the details of it. However, it is important to understand that the program <code>xgap</code> is highly machine or at least operating system dependent. There is no generic way to access graphics across different platforms up to now. XGAP should run on all variants of Unix with the X Window System Version 11 Release 5 or higher. As of now XGAP does not run on Microsoft Windows or MacOS. It is also definitely <strong>not</strong> easily ported there, because some important features that are used within XGAP are missing there (such as pseudo terminals). There are currently no plans underways to do work in this direction. However, portations are very welcome! If you would like to put some work into this, please contact Max Neunhöffer (email: <code>max.neunhoeffer@math.rwth-aachen.de</code>). <p> <p> <h2><a name="SECT004">2.4 Historical Remarks and Acknowledgements</a></h2> <p><p> A first program for drawing a diagram showing the lattice of subgroups of a finite group that had been calculated by a computer was implemented by H. Jürgensen in 1965 (see <a href="biblio.htm#FJ65"><cite>FJ65</cite></a>). <p> The design of XGAP was strongly influenced and in fact triggered by the QUOTPIC system of Derek Holt and Sarah Rees (see <a href="biblio.htm#HR91"><cite>HR91</cite></a>) which allows to depict graphically knowledge about normal subgroups of a finitely presented group found by a variety of methods for the investigation of finitely presented groups. It seemed most desirable to allow to depict in a similar way the even wider variety of information on subgroups of groups that can be obtained by a system such as <font face="Gill Sans,Helvetica,Arial">GAP</font>. <p> Beginning 1993, Frank Celler developed the idea of an interface from <font face="Gill Sans,Helvetica,Arial">GAP</font> to graphic systems that allowed to actually write commands for graphical tasks in the <font face="Gill Sans,Helvetica,Arial">GAP</font> language and together with Susanne Keitemeier (see <a href="biblio.htm#SK95"><cite>SK95</cite></a>) wrote a first version of programs in XGAP for drawing diagrams representing posets of subgroups of finite and finitely presented groups. We most gratefully acknowledge the help of Sarah Rees in implementing the interactive lattice functions and in beta testing the <font face="Gill Sans,Helvetica,Arial">GAP</font>3 version of XGAP. <p> In 1998, Thomas Breuer, Frank Celler, Joachim Neubüser and Max Neunhöffer planned the new concepts for the <font face="Gill Sans,Helvetica,Arial">GAP</font>4 version. The implementation and portation to <font face="Gill Sans,Helvetica,Arial">GAP</font>4 was done mainly by Max Neunhöffer in 1998 and 1999. Michael Ringe added the link to his MeatAxe programs. We like to thank all those who have adapted the <font face="Gill Sans,Helvetica,Arial">GAP</font> library to the needs of the new XGAP, in particular Alexander Hulpke who has been extremely helpful with this task. <p> <p> [<a href = "chapters.htm">Up</a>] [<a href ="CHAP001.htm">Previous</a>] [<a href ="CHAP003.htm">Next</a>] [<a href = "theindex.htm">Index</a>] <P> <address>XGAP manual<br>Mai 2004 </address></body></html>