#NEWLINE# def _verify_bsgs( group , base , gens ) : #NEWLINE# #INDENT# '\n    Verify the correctness of a base and strong generating set.\n\n    This is a naive implementation using the definition of a base and a strong\n    generating set relative to it. There are other procedures for\n    verifying a base and strong generating set, but this one will\n    serve for more robust testing.\n\n    Examples\n    ========\n\n    >>> from sympy.combinatorics.named_groups import AlternatingGroup\n    >>> from sympy.combinatorics.testutil import _verify_bsgs\n    >>> A = AlternatingGroup(4)\n    >>> A.schreier_sims()\n    >>> _verify_bsgs(A, A.base, A.strong_gens)\n    True\n\n    See Also\n    ========\n\n    sympy.combinatorics.perm_groups.PermutationGroup.schreier_sims\n\n    ' #NEWLINE# from sympy.combinatorics.perm_groups import PermutationGroup #NEWLINE# strong_gens_distr = _distribute_gens_by_base ( base , gens ) #NEWLINE# current_stabilizer = group #NEWLINE# for i in range ( len ( base ) ) : #NEWLINE# #INDENT# candidate = PermutationGroup ( current_stabilizer [ i ] ) #NEWLINE# if ( current_stabilizer . order ( ) != candidate . order ( ) ) : #NEWLINE# #INDENT# return False #NEWLINE# #UNINDENT# current_stabilizer = current_stabilizer . stabilizer ( base [ i ] ) #NEWLINE# #UNINDENT# if ( current_stabilizer . order ( ) != 1 ) : #NEWLINE# #INDENT# return False #NEWLINE# #UNINDENT# return True