class_docstr: Properties
  ==========
  
  [1] `0 \in \Omega` and `\tau(1) = \epsilon`
  [2] `\alpha^x = \beta \Leftrightarrow \beta^{x^{-1}} = \alpha`
  [3] If `\alpha^x = \beta`, then `H \tau(\alpha)x = H \tau(\beta)`
  [4] `\forall \alpha \in \Omega, 1^{\tau(\alpha)} = \alpha`
  
  References
  ==========
  
  .. [1] Holt, D., Eick, B., O'Brien, E.
         "Handbook of Computational Group Theory"
  
  .. [2] John J. Cannon; Lucien A. Dimino; George Havas; Jane M. Watson
         Mathematics of Computation, Vol. 27, No. 123. (Jul., 1973), pp. 463-490.
         "Implementation and Analysis of the Todd-Coxeter Algorithm"
class_docstr_tok: ["Properties","==========","[","1","]","`","0","\\in","\\Omega","`","and","`","\\tau","(","1",")","=","\\epsilon","`","[","2","]","`","\\alpha^x","=","\\beta","\\Leftrightarrow","\\beta^","{","x^","{","-1","}","}","=","\\alpha","`","[","3","]","If","`","\\alpha^x","=","\\beta","`",",","then","`","H","\\tau","(","\\alpha",")","x","=","H","\\tau","(","\\beta",")","`","[","4","]","`","\\forall","\\alpha","\\in","\\Omega",",","1^","{","\\tau","(","\\alpha",")","}","=","\\alpha","`","References","==========","..","[","1","]","Holt",",","D.",",","Eick",",","B.",",","O'Brien",",","E.","``","Handbook","of","Computational","Group","Theory","''","..","[","2","]","John","J.","Cannon",";","Lucien","A.","Dimino",";","George","Havas",";","Jane","M.","Watson","Mathematics","of","Computation",",","Vol",".","27",",","No",".","123",".","(","Jul.",",","1973",")",",","pp",".","463-490",".","``","Implementation","and","Analysis","of","the","Todd-Coxeter","Algorithm","''"]
docstr: When combined with the HLT method this is known as HLT+Lookahead
  method of coset enumeration, described on pg. 164 [1]. Whenever
  ``define`` aborts due to lack of space available this procedure is
  executed. This routine helps in recovering space resulting from
  "coincidence" of cosets.
docstr_tok: ["When","combined","with","the","HLT","method","this","is","known","as","HLT+Lookahead","method","of","coset","enumeration",",","described","on","pg",".","164","[","1","]",".","Whenever","``","define","``","aborts","due","to","lack","of","space","available","this","procedure","is","executed",".","This","routine","helps","in","recovering","space","resulting","from","''","coincidence","''","of","cosets","."]
code: def look_ahead(self):
      """
      When combined with the HLT method this is known as HLT+Lookahead
      method of coset enumeration, described on pg. 164 [1]. Whenever
      ``define`` aborts due to lack of space available this procedure is
      executed. This routine helps in recovering space resulting from
      "coincidence" of cosets.
  
      """
      R = self.fp_group.relators
      p = self.p
      # complete scan all relators under all cosets(obviously live)
      # without making new definitions
      for beta in self.omega:
          for w in R:
              self.scan(beta, w)
              if p[beta] < beta:
                  break
  
imports: from sympy.combinatorics.free_groups import free_group
  from sympy.printing.defaults import DefaultPrinting
  from itertools import chain, product
  from bisect import bisect_left
label_desc: Use image node_id 18 for calling the CosetTable obj's underlying member method code with example usage: obj.look_ahead() without return types