This is an abstract class. This class is used by function bsgs. You have to implement this class for using bsgs.
bsgs has to know the unit of a target group. retunit returns the unit of it.
bsgs uses a random element when it computes the order of target group. retnext returns a random element of target group.