class_docstr: A class implementing rewriting systems for `FpGroup`s.
  
  References
  ==========
  .. [1] Epstein, D., Holt, D. and Rees, S. (1991).
         The use of Knuth-Bendix methods to solve the word problem in automatic groups.
         Journal of Symbolic Computation, 12(4-5), pp.397-414.
  
  .. [2] GAP's Manual on its KBMAG package
         https://www.gap-system.org/Manuals/pkg/kbmag-1.5.3/doc/manual.pdf
class_docstr_tok: ["A","class","implementing","rewriting","systems","for","`","FpGroup","`","s",".","References","==========","..","[","1","]","Epstein",",","D.",",","Holt",",","D.","and","Rees",",","S.","(","1991",")",".","The","use","of","Knuth-Bendix","methods","to","solve","the","word","problem","in","automatic","groups",".","Journal","of","Symbolic","Computation",",","12","(","4-5",")",",","pp.397-414",".","..","[","2","]","GAP","'s","Manual","on","its","KBMAG","package","https",":","\/\/www.gap-system.org\/Manuals\/pkg\/kbmag-1.5.3\/doc\/manual.pdf"]
docstr: Compute the inverse rules for a given set of rules.
  The inverse rules are used in the automaton for word reduction.
  
  Arguments:
      rules (dictionary): Rules for which the inverse rules are to computed.
  
  Returns:
      Dictionary of inverse_rules.
docstr_tok: ["Compute","the","inverse","rules","for","a","given","set","of","rules",".","The","inverse","rules","are","used","in","the","automaton","for","word","reduction",".","Arguments",":","rules","(","dictionary",")",":","Rules","for","which","the","inverse","rules","are","to","computed",".","Returns",":","Dictionary","of","inverse_rules","."]
code: def _compute_inverse_rules(self, rules):
      """
      Compute the inverse rules for a given set of rules.
      The inverse rules are used in the automaton for word reduction.
  
      Arguments:
          rules (dictionary): Rules for which the inverse rules are to computed.
  
      Returns:
          Dictionary of inverse_rules.
  
      """
      inverse_rules = {}
      for r in rules:
          rule_key_inverse = r**-1
          rule_value_inverse = (rules[r]) ** -1
          if rule_value_inverse < rule_key_inverse:
              inverse_rules[rule_key_inverse] = rule_value_inverse
          else:
              inverse_rules[rule_value_inverse] = rule_key_inverse
      return inverse_rules
  
file_path: sympy/sympy/combinatorics/rewritingsystem.py
imports: from collections import deque
  from sympy.combinatorics.rewritingsystem_fsm import StateMachine
label_desc: Use image node_id 11 for calling the RewritingSystem obj's underlying member method code with example usage: obj._compute_inverse_rules(rules) and returns: inverse_rules