Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Download

GAP 4.8.9 installation with standard packages -- copy to your CoCalc project to get it

610987 views
1
\Chapter{What is XGAP?}
2
3
In this chapter you find the answer to the above question beginning from a
4
short overview up to a description of the technical concept.
5
6
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7
\Section{Basics}
8
9
The idea of \XGAP~is that \GAP~should be able to control graphics. A
10
graphical user interface is sometimes easier to use than a text and
11
command oriented one and there are mathematical applications for which it
12
can be quite useful to visualize objects with computer graphics.
13
14
On the other hand it is not sensible to change the whole concept and user
15
interface of {\GAP} because it is not advisable to put all the facilities of
16
{\GAP} into a menu system. So \XGAP~is a separate C program running under the
17
X Window System, which starts up a \GAP~job and allows normal command
18
execution within a window. Note that the online help of {\GAP} is
19
available, however it will appear in a separate window.
20
21
In addition there is a library written in \GAP, which makes it
22
possible to open new windows, display graphics, control menus and do
23
other graphical user communication in \GAP~via the separate C part.
24
25
Built on those ``simple'' windows and graphic objects are other libraries
26
which display graphs and posets in a window and allow the user to move
27
vertices around, select them and invoke \GAP~functions on mathematical
28
objects which belong to the graphic objects.
29
30
One ``application'' of these libraries is a program to display subgroup
31
lattices interactively. So \XGAP~works as a front end for mathematical
32
operations on subgroup lattices. It is possible to ``switch'' between the
33
graphics and the \GAP~commands. This means that you can for example use the
34
graphically selected vertices resp. subgroups to do your own calculations
35
in the command window. You can then display your results again as vertices
36
in the lattice.
37
38
Of course there are other applications possible and the libraries are
39
developed with code reusage in mind.
40
41
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
42
\Section{What you can do with XGAP}
43
44
{\XGAP} graphic sheets work graphic object oriented. This means that the
45
basic graphic objects are not pixels but lines, rectangles, circles and so
46
on. Although technically everything on the screen consists of pixels
47
{\XGAP} remembers the structure of your graphics via higher objects. This
48
has advantages as well as disadvantages. Do not expect to be able to
49
place pixel images into your {\XGAP} graphic sheets. That is as of now
50
*not possible* with {\XGAP} and probably will never be, because it is not
51
the idea of the design.
52
53
What you can do is create, move around and change lines, circles, text and
54
so forth in graphic sheets. Your programs can communicate with the user via
55
graphical user interfaces like mouse, menus, dialogs, and so on.
56
57
It is very easy to link this graphical environment with your programs in
58
the mathematical environment of {\GAP}. So you can very quickly implement
59
visualizations of the mathematical objects you study. The user can select
60
objects, choose functions from menus and ask for more information with a
61
few mouse clicks.
62
63
A good example for this approach is the implementation of the interactive
64
Todd-Coxeter-Algorithm to compute coset tables in finitely presented
65
groups. It uses the graphical features of {\XGAP} to give the user quick
66
and easy access to the algorithm by a few mouse clicks. This program was
67
written by Ludger Hippe in Aachen using {\XGAP3} and is currently ported to
68
{\XGAP4} and extended by Volkmar Felsch.
69
70
Another nice little example is in the `examples' subdirectory in the
71
{\XGAP} distribution. It was written by Thomas Breuer (Aachen) to
72
demonstrate the features of {\XGAP}. The user gets a small window with a
73
puzzle and can solve it using the mouse. You can test this example by
74
starting {\XGAP} and `Read'ing the file `pkg/xgap/examples/puzzle.g'.
75
You can do this by using
76
77
\begintt
78
gap> ReadPkg("xgap","examples/puzzle.g");
79
gap> p := Puzzle(4,4);
80
\endtt
81
82
You do not have to invent the wheel many times. For certain mathematical
83
concepts like graphs, posets or lattices {\XGAP} provides implementations
84
which can
85
be adapted to your special situation. You can use those parts of the code
86
you like and substitute the other parts to adapt the behaviour of the user
87
interface to your wishes.
88
89
90
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
91
\Section{How does it work?}
92
93
{\XGAP} consists of a C program `xgap' (in the following `xgap' in
94
typewriter style refers to this C part) separate from {\GAP}, and of some
95
libraries written in the {\GAP} language. `xgap' is started by the
96
user and launches a {\GAP} job in the background. It then talks
97
to this {\GAP} job. Especially it displays all the output which comes from
98
{\GAP} in the communication window and feeds everything the user types in
99
this window into the {\GAP} job.
100
101
But there is also some communication with the {\GAP} job about the graphics
102
that should be displayed. Because {\GAP} has no concept of putting graphics
103
on the screen, this part is done by `xgap'. Therefore there is a protocol
104
between the {\GAP} part of {\XGAP} running in the {\GAP} session and `xgap'
105
which is embedded in the input/output stream. The user does not notice
106
this. `xgap' stores all windows and graphic objects and does all the work
107
necessary for displaying windows and managing user communication and so on.
108
109
The {\GAP} part of {\XGAP} also stores all graphical information, but in
110
form of {\GAP} objects. The user can inspect all these structures and use
111
them in own programs. Changes in these structures are transmitted through
112
the communications protocol to `xgap' and are eventually displayed on the
113
screen. User actions like mouse clicks or keyboard events are caught by
114
`xgap' and transmitted to the {\GAP} job via function calls that are
115
``typed in'' as if the user had typed them. So the library can work on them
116
and change the {\GAP} objects accordingly.
117
118
Technically, {\XGAP} is a package and one of the first commands that
119
is executed automatically within the {\GAP} session is a
120
`LoadPackage("xgap")' call. This reads in the extra {\XGAP}
121
libraries. They are found in the `pkg/xgap/lib' subdirectory, normally in the
122
main {\GAP} directory. The files contain the following:
123
124
\beginitems
125
`window.g' & basic definitions for the communications protocol
126
127
`sheet.g[di]' & graphic sheets and their operations
128
129
`color.g[di]' & color information
130
131
`font.g[di]' & text font information
132
133
`menu.g[di]' & menus, dialogs, popups, and user communication
134
135
`gobject.g[di]'& low level graphic objects and their operations
136
137
`poset.g[di]' & graphic graphs and graphic posets
138
139
`ilatgrp.g[di]'& graphic subgroup lattices
140
141
`meataxe.g[di]'& support to display submodule lattices calculated within
142
the C MeatAxe
143
\enditems
144
145
The user normally does not need to know this or the details of it. However,
146
it is important to understand that the program `xgap' is highly machine or
147
at least operating system dependent. There is no generic way to access
148
graphics across different platforms up to now. {\XGAP} should run on all
149
variants of Unix with the X Window System Version 11 Release 5 or
150
higher. As of now {\XGAP} does not run on Microsoft Windows. It is
151
also definitely *not* easily ported there, because some important features
152
that are used within {\XGAP} are missing there (such as pseudo terminals).
153
There are currently no plans underways to do work in this direction.
154
155
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
156
\Section{Historical Remarks and Acknowledgements}
157
158
A first program for drawing a diagram showing the lattice of subgroups
159
of a finite group that had been calculated by a computer was
160
implemented by H. J\accent127urgensen in 1965 (see \cite{FJ65}).
161
% [quote K. Ferber, H. Juergensen,
162
%A programme for drawing a lattice. p. 83 - 86 of J. Leech,
163
%ed. Computational Problems in Abstract Algebra, 1970]
164
165
The design of {\XGAP} was strongly influenced and in fact triggered by
166
the QUOTPIC system of Derek Holt and Sarah Rees (see \cite{HR91})
167
%[quote D.Holt, S.
168
%Rees, A Graphics System for Displaying Finite Quotients of Finitely
169
%Presented Groups p. 113 - 126 of L. Finkelstei, W.M. Kantor, Groups
170
%and Computation, DIMACS 1991]
171
%
172
which allows to depict graphically knowledge about normal subgroups of
173
a finitely presented group found by a variety of methods for the
174
investigation of finitely presented groups. It seemed most desirable
175
to allow to depict in a similar way the even wider variety of
176
information on subgroups of groups that can be obtained by a system
177
such as {\GAP}.
178
179
Beginning 1993, Frank Celler developed the idea of an interface from
180
{\GAP} to graphic systems that allowed to actually write commands for
181
graphical tasks in the {\GAP} language and together with Susanne
182
Keitemeier (see \cite{SK95}) wrote a first version
183
of programs in {\XGAP} for drawing diagrams representing posets of
184
subgroups of finite and finitely presented groups. We most gratefully
185
acknowledge the help of Sarah Rees in implementing the interactive
186
lattice functions and in beta testing the {\GAP3} version of {\XGAP}.
187
188
In 1998, Thomas Breuer, Frank Celler, Joachim Neub\accent127user and Max
189
Neunh\accent127offer planned the new concepts for the {\GAP4}
190
version. The implementation and porting to {\GAP4} was done mainly by Max
191
Neunh\accent127offer in 1998 and 1999. Michael Ringe added the link to his
192
MeatAxe programs. We like to thank all those who have adapted the {\GAP}
193
library to the needs of the new {\XGAP}, in particular Alexander Hulpke who
194
has been extremely helpful with this task.
195
196
197