8.3 Immediate and True Methods

In the example in Section Properties and Filters, we have mentioned that the operation Size has a method for solvable permutation groups that is so far superior to the method for general permutation groups that it seems worthwhile to try it even if nothing is known about solvability of the group of which the Size is to be calculated. There are other examples where certain methods are even ``cheaper'' to execute. For example, if the size of a group is known it is easy to check whether it is odd, and if so, the Feit-Thompson theorem allows us to set IsSolvableGroup to true for this group. GAP utilizes this celebrated theorem by having an immediate method for IsSolvableGroup with required filter HasSize which checks parity of the size and either sets IsSolvableGroup or does nothing, i.e., calls TryNextMethod(). These immediate methods are executed automatically for an object whenever the value of a filter changes, so solvability of a group will automatically be detected when an odd size has been calculated for it (and therefore the value of HasSize for that group has changed to true).

Some methods are even more immediate, because they do not require any calculation at all: They allow a filter to be set if another filter is also set. In other words, they model a mathematical implication like IsGroup and IsCyclic Þ IsSolvableGroup and such implications can be installed in GAP as true methods. To execute true methods, GAP only needs to do some bookkeeping with its filters, therefore true methods are much faster than immediate methods.

How immediate and true methods are installed is described in Immediate Methods and Logical Implications in ``Programming in GAP''.

[Top] [Previous] [Up] [Next] [Index]

GAP 4 manual
February 2000