File: SMFPGroup.h

package info (click to toggle)
magnus 20060324-3
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 19,404 kB
  • ctags: 20,466
  • sloc: cpp: 130,118; ansic: 37,076; tcl: 10,970; perl: 1,109; makefile: 963; sh: 403; yacc: 372; csh: 57; awk: 33; asm: 10
file content (170 lines) | stat: -rw-r--r-- 5,911 bytes parent folder | download | duplicates (3)
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
// Copyright (C) 1995 The New York Group Theory Cooperative
// See magnus/doc/COPYRIGHT for the full notice.

// Contents: Declaration of class SMFPGroup
//
// Principal Author: Roger Needham
//
// Status: in progress
//
// Revision History:
//

#ifndef _SMFPGROUP_H_
#define _SMFPGROUP_H_


#include "AlgebraicObject.h"
#include "FPGroup.h"
#include "GIC.h"
#include "GCM.h"
#include "Supervisor.h"

//@njz:
#include "ComputationManager.h"
//

// This class is used to wrap all types of finitely presented groups,
// including free ones. The main reason is the strong typing required by
// the interface to the FE; if, e.g., free groups were a separate type,
// we would need four kinds of maps: FP -> FP, FP -> Free, etc.
// 
// Unfortunately, this leads to other hassles: to do a specialized
// computation for a certain kind of group, one must either `intercept'
// the computation request with a specialized computation manager, or
// check for the special kind in the generic computation manager.
// 
// This class also records information about the group which is true by
// the end user's definition:
// 
//   * The group was entered with an empty relator set. The more general
//     information that the group is free (on some set of generators) is
//     recorded by the GIC.
// 
//   * The group was entered as an abelian (resp. nilpotent)
//     presentation. The commutators are not stored in the relator set of
//     the `theGroup' member (unless the end user typed them). All
//     computations with abelian (resp. nilpotent) groups are intercepted
//     by specialized CMs which use the commutators implicitly.

//@rn Perhaps free is the only special case in this sense?


//---------------------------------------------------------------------------//
//--------------------------- SMFPGroup -------------------------------------//
//---------------------------------------------------------------------------//

class SMFPGroup : public AlgebraicObject
{

  //@njz:
  friend class ComputationManager;
  //

public:

  enum Checkin_Type {
	 FP, FREE, ABELIAN, NILPOTENT, SMALL_CANCELLATION, ONE_RELATOR,
	 AP_FREE, AP_FREE_CYCLIC, FREE_NILPOTENT, HNN_FREE, ONE_RELATOR_WITH_TORSION
  };

  /////////////////////////////////////////////////////////////////////////
  //                                                                     //
  // Constructors:                                                       //
  //                                                                     //
  /////////////////////////////////////////////////////////////////////////

  SMFPGroup(const FPGroup& G, const Chars heritage, Checkin_Type t = FP,
	    Chars def = Chars());

  SMFPGroup( ) : AlgebraicObject( "" ), gic( oid() ), theGCM( 0 ) { }
  //@rn Bogus ctor; see `But no' comment in Menu.h.

  /////////////////////////////////////////////////////////////////////////
  //                                                                     //
  // Accessors:                                                          //
  //                                                                     //
  /////////////////////////////////////////////////////////////////////////

  FPGroup getFPGroup( ) const { return theGroup; }

  FreeGroup getFreePreimage( ) const { return theFreePreimage; }
  // When this group is F/R, it may be handy to have F.

  GCM& gcm() const { return *theGCM; }

  Checkin_Type getCheckinType( ) const { return checkin_type; }

  Chars getCheckinTypeStr( ) const;
  // Returns the checkin_type as a string of characters.
  
  
        InformationCenter* infoCenter()       { return &gic; }
  const InformationCenter* infoCenter() const { return &gic; }

  /////////////////////////////////////////////////////////////////////////
  //                                                                     //
  // Front End Interfacing:                                              //
  //                                                                     //
  /////////////////////////////////////////////////////////////////////////

  static const char* type( ) { return "SMFPGroup"; }

  const IconID iconID( ) const { return IconID::group; }  // overrides SMObject

  const char* typeID( ) const { return type(); }          // overrides SMObject

  void viewStructure(ostream& ostr) const;                // overrides SMObject

  void printProperties(ostream& ostr) const;              // overrides SMObject

  void printDefinition(ostream& ostr) const;              // overrides SMObject

  static void printGlobalMessageTemplates(ostream& ostr) {

    ostr << "init_map_gens_msg_ {${viewID} " << GENS_MAP_REQUEST
	 << " ${oid2} ${message} }" << endl;
    
  }

protected:

  /////////////////////////////////////////////////////////////////////////
  //                                                                     //
  // Restricted Access:                                                  //
  //                                                                     //
  /////////////////////////////////////////////////////////////////////////

  void readMessage(istream&);                          // overrides SMObject


  /////////////////////////////////////////////////////////////////////////
  //                                                                     //
  // Data Members:                                                       //
  //                                                                     //
  /////////////////////////////////////////////////////////////////////////

public:

  GIC gic;

private:

  // These are the tags for messages handled by objects in this class:
  enum MessageTag {
    GENS_MAP_REQUEST
  };

  GCM* theGCM;  // TheObjects removes theGCM when this is removed.

  const FPGroup theGroup;

  const FreeGroup theFreePreimage;

  Checkin_Type  checkin_type;

  Chars definition;
  
};

#endif