Finally we look how to implement a new concept for existing objects and fit this in the method selection. Three examples that will be made more explicit below would be groups for which a ``length'' of elements (as a word in certain generators) is defined, groups that can be decomposed as a semidirect product and M-groups.
In each case we have two possibilities for the declaration. We can either declare it as a property or as a category. Both are eventually filter and in this way indistinguishable for the method selection. The distinction is rather conceptual and mainly reflects whether we want existing objects to be part of our new concept or not.
IsXYZ, declared as subcategory
of IsABC is therefore exactly the same as if we would declare IsXYZ to
be a property for IsABC and install the following method:
InstallMethod(IsXYZ,"return false if not known",[IsABC],ReturnFalse);
category also has a
well-defined mathematical meaning, but this does not need to concern us at
this point.
The set of objects which is defined to be a (GAP)-category does
not need to be a category in the mathematical sense, vice versa not every
mathematical category is declared as a (GAP) category.)
Sometimes there is even a third possiblity (if you have GAP 3 experience
this might reflect most closely ``an object whose operations record is
XYOps''): We might want to indicate this new concept simply by the fact
that certain attributes are set. In this case we could simply use the
respective attribute tester(s).
The examples given below each give a short argument why the respective solution was chosen, but one could argue as well for other choices.
[Top] [Previous] [Up] [Next] [Index]
GAP 4 manual